var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                       .getInterface(Components.interfaces.nsIWebNavigation)
                       .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
                       .rootTreeItem
                       .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                       .getInterface(Components.interfaces.nsIDOMWindow);                     
function startup() {
    CultureMuncher.canvas = document.getElementById('culturemunchersb');
	
	// for(var i = 0;i<3;i++){
	    // var imgCanvas = document.createElementNS("http://www.w3.org/1999/xhtml",'html:canvas');
	    // imgCanvas.setAttribute("width",200);
	    // imgCanvas.setAttribute("height",150);
	    // imgCanvas.getContext("2d").fillRect(0,0,200,150);   
	    // var canvasVbox = document.createElementNS("http://www.w3.org/1999/xhtml",'vbox');
	    // ee.appendChild(canvasVbox);
// 	
	    // var canvasLabel = document.createElement("label");
	    // canvasLabel.setAttribute("value",i);
	    // canvasLabel.setAttribute("flex",1);
	    // canvasVbox.setAttribute("flex",1);
	    // canvasVbox.appendChild(imgCanvas);
	    // canvasVbox.appendChild(canvasLabel);
// 	
	    // ee.appendChild(canvasVbox);
  	// }
}

function shutdown() { 
}


window.addEventListener("load", startup, false);
window.addEventListener("load", function () { CultureMuncher.onLoad(mainWindow.gBrowser); }, false);
window.addEventListener("unload", shutdown, false);
window.addEventListener("unload", function () { CultureMuncher.onUnLoad(mainWindow.gBrowser); }, false);


                       
 